import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";

// 路由监听
import "./permission";

import "nprogress/nprogress.css";

// 全局导入 element Plus (打包时需要使用 按需导入)
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

// 导入自定义样式
import "@/styles/main.scss";
import { setUpElIcon } from "./components";
import { initColor } from "./config/theme";

const app = createApp(App);

// 更改为中文
import zhCn from "element-plus/es/locale/lang/zh-cn";

import NilEleUI from "@nil-tools/nil-ele-ui";
import "@nil-tools/nil-ele-ui/lib/styles/index.css";

// 自动导入组件
// setUpNilComponent(app);
setUpElIcon(app);

app.use(ElementPlus, {
  locale: zhCn,
});
app.use(NilEleUI);
app.use(createPinia());
app.use(router);

app.mount("#app");

// 初次进入 初始化样式
initColor();
